package com.example.demo;

import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity {
	 private EditText IP;
	 private EditText Port;
	 private Button Login;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        IP   = (EditText) findViewById(R.id.editTextIp);
        Port = (EditText) findViewById(R.id.editTextPort);
        Login= (Button)   findViewById(R.id.ButtonLogin);
        Login.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				//connect to server pc
				
				String ipString  =IP.getText().toString();
				String portString=Port.getText().toString();
				Bundle sendBundle = new Bundle();
				sendBundle.putString("ipString", ipString);
				sendBundle.putString("portString",portString);
				Intent i = new Intent(MainActivity.this, kien.class);
				i.putExtras(sendBundle);
				startActivity(i);
			}
		});
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}
